#include <iostream>
using namespace std;

bool isgood(int x) {
  int flag = 1;
  while (x) {
    if (((x % 10) % 2 != 0) != (flag % 2 != 0)) return false;
    x /= 10;
    flag++;
  }
  return true;
}

int main() {
  int n, ans = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    ans += isgood(i);
  }
  cout << ans << endl;
  return 0;
}